/**
 * @type {Number}
 *
 * @properties={typeid:35,uuid:"BF79CFD8-8310-4C87-A11F-E958AE8112D2",variableType:4}
 */
var fControl = 0;

/**
 * @type {String}
 *
 * @properties={typeid:35,uuid:"A4FFF2D1-831B-4BFF-8893-24ABA7CFD112"}
 */
var fPass1 = null;

/**
 * @type {String}
 *
 * @properties={typeid:35,uuid:"1383993C-9CFF-4E3F-957E-78CC1E7BFD42"}
 */
var fPass2 = null;

/**
 * @properties={typeid:24,uuid:"D7CBE710-5821-430F-A398-E79A3B50DA8A"}
 */
function cambiarPass(event) {
	if(fPass1 == fPass2)
	{
		var p = globals.hashPass(fPass1)
		hash_pass = p
		fPass1 = null
		fPass2 = null
		databaseManager.saveData()
		fControl = 1
		var $win = application.getWindow('CAMBIO_PASS')
		$win.hide()
		$win.destroy()
	}
	else
	{
		fPass1 = null
		fPass2 = null
		globals.DIALOGS.showErrorDialog('Error','Verificacion de contraseña fallo','OK')
	}
}

/**
 * Handle hide window.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @returns {Boolean}
 *
 * @properties={typeid:24,uuid:"E59BBFB8-31EC-4394-873F-BCCA86820C41"}
 */
function onHide(event) {
	if (fControl == 1)
	{
		fControl = 0
		return true
	}
	return false
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"9D079CA8-DE65-4601-90B4-14FAA13DFD45"}
 */
function cancelar(event) {
	fControl = 1
	var $win = application.getWindow('CAMBIO_PASS')
	$win.hide()
	$win.destroy()
}
